<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>事件鼠标</title>
		<style type="text/css">
			input{
				border: 1px solid #01f;
			}
		</style>
	</head>
	<body>
		<!--<div style="width:100px;height: 100px;background-color: red;position: absolute;left: 0;top: 0;"></div>-->
		<!--//input focus blur change-->
		
		<!--<input type="text"/>-->
		
		<input type="text" value="请输入用户名" style="color:#999" onfocus="if(this.value == '请输入用户名'){this.value=''}" onblur="if(this.value==''){this.value='请输入用户名'}"/>
		
		
		
		
		<script type="text/javascript">
			/*
			 * click mousedown mousemove mouseup
			 * contextmenu mouseover mouseout mouseenter
			 * mouseleave
			 * 
			 * 用button的0/1/2代表三个键
			 * 
			 */
			//var div = document.getElementsByTagName('div')[0];
			
			/*document.onmousemove = function(e){
				var event = e || window.event;
				console.log(e.pageX + ":" + e.pageY);
				div.style.left = e.pageX + "px";;
				div.style.top = e.pageY + "px";;
			}*/
			
			/*var disX,disY;
			document.onmousedown = function(e){
				var event = e || window.event;
				disX = event.pageX - parseInt(div.style.left);
				disY = event.pageY - parseInt(div.style.top);
				document.onmousemove = function(e){
					var event = e || window.event;
					div.style.left = event.pageX - disX + "px";
					div.style.top = event.pageY -  disY + "px";
				};
				
				document.onmouseup = function(){
					document.onmousemove = null;
				};
			}*/
			
			/*document.onkeydown = function(e){
				console.log(e);
			}
			
			document.onkeyup = function(e){
				console.log(e);
			}
			
			document.onkeypress = function(e){
				console.log(e);
			}*/
			
			/*var input = document.getElementsByTagName('input')[0];
			input.oninput = function(e){
				console.log(this.value);
			}
			input.onchange = function(e){
				console.log(this.value);
			}*/
			
			
			
			
			
		</script>
	</body>
</html>
